﻿using System.Configuration;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using JuCheap.Service.Data;

namespace JuCheap.WebUI
{
    public class MvcApplication : HttpApplication
    {
        protected void Application_Start()
        {
            if (ConfigurationManager.AppSettings["ShowSqlToEntityFrameworkProfiler"] == "true")
            {
                HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize();
            }

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            IOCConfig.Register();

            DatabaseInit.Init();
        }
    }
}
